//
//  UIView+Extension.swift
//  SinaWeibo
//
//  Created by QUAN on 15/11/17.
//  Copyright © 2015年 QUAN. All rights reserved.
//

import UIKit

extension UIView {
    
    func NavController() -> UINavigationController? {
        
        //获取下一个响应者
        var next = self.nextResponder()
        
        repeat{
            
        if next is UINavigationController {
            
            return next as? UINavigationController
            
            }
            
        next = next?.nextResponder()
            
        }while(next != nil)
     
        return nil
    }
    
}
